<template>
	<view class="content">
		<!-- 顶部边 -->
		<view class="top"></view>
		<!-- 轮播图 -->
		<u-swiper class="swiper" :list="list" 
				indicator-pos="bottomRight" 
				:circular="true"
				:effect3d="true"
				:title="true" @click="swiperTo()"></u-swiper>
		<!-- 菜单导航 -->
		<u-row gutter="2" class="menus-list" justify="start" >
			<u-col span="3" v-for="(item,index) in 10">
				<view class="demo-layout bg-purple">
					<view class="menus-item">
						<!-- 菜单栏内部 -->
						<view class="menus-item-icon">
							<view class="iconfont icon-icon_personal icon-image"></view>
						</view>
						<view class="menus-item-title">
							<text style="font-size: 12rpx;">这是标题哦你</text>
						</view>
					</view>
				</view>
			</u-col>
		</u-row>
		<!-- 测试 -->
		<u-button type="primary" style="margin-top: 20rpx;" @click="getLoginInfo()" >查看信息</u-button>
	</view>
</template>

<script>
	//引入函数
	import { getMenus } from '@/api/home';
	export default {
		data() {
			return {
				list: [{
						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
						title: '昨夜星辰昨夜风，画楼西畔桂堂东'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
						title: '身无彩凤双飞翼，心有灵犀一点通'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
						title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
					}
				],
			}
		},
		mounted() {
			this.initMenus()
		},
		methods: {
			// 获取个人信息
			initMenus(){
				getMenus().then( res => {
					console.log(res)
				})
			},
			// 轮播图跳转
			swiperTo(){
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		
		.top{
			height: 50rpx;
		}
		.menus-list{
			width: 95%;
			display: flex;
			margin: 0 auto;
			margin-top: 30rpx;
			align-items: center;
			align-self: center;
			.menus-item{
				margin-top: 20rpx;
				height: 140rpx;
				width: 100%;
				.menus-item-icon{
					display: flex;
					align-self: center;
					margin: 0 auto;
					width: 80%;
					height: 60%;
					.icon-image{
						font-size: 36px;
						margin: 0 auto;
					}
				}
				.menus-item-title{
					display: flex;
					justify-content: center;
					align-self: center;
					align-items: center;
					margin: 0 auto;
					width: 100%;
					height: 35%;
				}
			}
		}
	}
</style>